import os
import cv2

#########################################################################################################
#   |   黑  |  白   |   灰  |         红        |  橙    |   黄   |   绿  |   青    |   蓝     |   紫    |#
# ------------------------------------------------------------------------------------------------------#
# H | 0-180 | 0-180 | 0-180 | (0-10)/(156-180) | 11-25  | 26-34  | 35-77 | 78-99  | 100-124  | 125-155 |#
# ------------------------------------------------------------------------------------------------------#
# S | 0-255 | 0-43  | 0-30  |      43-255      | 43-255 | 43-255 |43-255 | 43-255 |  43-255  | 43-255  |#
# ------------------------------------------------------------------------------------------------------#
# V | 0-46  | 46-220|221-255|      46-255      | 46-255 | 46-255 | 46-255| 46-255 | 46-255   |  46-255 |#
#########################################################################################################


class SingleColor:
    """
    对图片中单一颜色进行操作，使用区域为HSV
    """
    road_color = []          # 省道
    river_color = []         # 河流

    def set_road_color(self, color):
        self.road_color = color
        assert isinstance(self.road_color, list)

    def set_river_color(self, color):
        self.river_color = color
        assert isinstance(self.road_color, list)

    def get_road_color(self):
        return self.road_color

    def get_river_color(self):
        return self.river_color


class ColorRange:
    """
    对每种颜色进行取值一个范围,像素取值为HSV
    """
    road_color = [(), (), ()]          # 橙色
    river_color = [(), (), ()]

    def set_road_color(self, color):
        self.road_color = color
        assert isinstance(self.road_color, list)

    def set_river_color(self, color):
        self.river_color = color
        assert isinstance(self.river_color, list)

    def get_road_color(self):
        return self.road_color

    def get_river_color(self):
        return self.river_color






